#include <iostream>

using namespace std;

int
main ()
{
    x1="(";
    x2=")";
    y1="[";
    y2="]";
    z1="{";
    z2="}";

  int x, y, s, f, g, d,a,b, c;
  cin >> a >> b >> c >> d >> f >> g;

    if (a==x2||a==y2||a==z2)
        cout<<"False";
    if (g==x1||g==y1||g==z1)
        cout<<"False";
    if (a==x1 &&  b==x2 && c==y1 &&  d==y2  && f==z1 &&  g==z2)
        cout<<"True";

}
